<template>
  <span class="card-span"
        v-bind:style="{background: 'url(' + picUrl + ')',backgroundSize:'cover',backgroundPosition:'center'}">
    <div class="origin-content">
      <h4 class="card-name">{{name}}</h4>
      <p class="card-title">{{title}}</p>
    </div>
    <a href="#">
      <div class="mask">
        <div>
          <!--<div>-->
            <!--<h4 class="card-name">{{name}}</h4>-->
            <!--<p class="card-title">{{title}}</p>-->
          <!--</div>-->

          <div class="card-detail">
            {{detail}}
          </div>
        </div>
      </div>
    </a>
  </span>
</template>

<script>
export default {
  name: "PeopleCard1",
  props: {
    picUrl: String,
    name: String,
    title: String,
    detail: String
  },
  methods: {
    doClick() {
      this.$emit("clickCallBack");
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.card-span {
  text-align: start;

  height: 300px;
  display: flex;
  flex-direction: column;
  width: 220px;
  padding-left: 20px;
  padding-top: 30px;
  /* flex: 1; */
  position: relative;
  margin-right: 20px;
}
.card-name {
  width: 21px;
  color: #000;
  line-height: 30px;
  margin: 0 8px 0 auto;
  font-size: 15px;
  float: left;
  text-align: center;
  font-weight: 600;
  writing-mode: vertical-rl;
}

.card-detail {
  position: absolute;
  width: 165px;
  height: 85px;
  font-size: 8px;
  color: #fff;
  /* line-height: 20px; */
  /* bottom: 77px; */
  top: 20px;
  text-align: left;
}

.card-span:hover .mask {
  opacity: 1;
}

.card-span:hover .origin-content {
  opacity: 0;
}

.origin-content {
  opacity: 1;
}

.mask {
  padding-left: 20px;
  padding-top: 30px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 300px;
  left: 0;
  right: 0;
  text-align: center;
  -webkit-backface-visibility: hidden; /* 隐藏旋转元素的背面*/
  backface-visibility: hidden;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  -webkit-transition: all 2s ease-in-out;
  -moz-transition: all 2s linear;
  transition: all 2s cubic-bezier(0.23, 1, 0.32, 1);

  -ms-transform: scaleY(1);
  transform: scaleY(1);
  transform-origin: left bottom;
}

.card-title {
  width: 18px;
  padding-bottom: 4px;
  background: #72757e;
  font-size: 12px;
  color: #fff;
  line-height: 13px;
  text-align: center;
  box-sizing: border-box;
  padding-top: 3px;
  float: left;
  margin-top: 6px;
  margin-bottom: 90px;
}

.card-sub-title {
  font-size: 18px;
  color: #f5f5f5;
  letter-spacing: 1px;
  line-height: 35px;
}

.myButton {
  background: transparent;
  color: white;
  border: 1px solid #ffffff;
  border-radius: 0;
  font-weight: bold;
  padding: 10px 55px 35px 55px;
  font-size: 20px;
}
.myButton:hover {
  background: #35bfa5;
  border: 0;
}
</style>
